<?php
/**
 * @copyright	Copyright (C) 2008 Bideew. All rights reserved.
 * @license		GNU/GPL
* This file is part of Bideew.

* Bideew is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* any later version.

* Bideew is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.

* You should have received a copy of the GNU General Public License
* along with Bideew; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

class Article {
		public $id;
		public $user_id;
		public $categories;
		public $titre;
		public $entete;
		public $contenu;
		public $date_publication;

	public function __construct($id,$user_id,$categorie_id,$titre,$entete,$contenu,$date_publication) {
		$this->id=$id;
		$this->user_id=$user_id;
		$this->categorie_id=$categorie_id;
		$this->titre=$titre;
		$this->entete=$entete;
		$this->contenu=$contenu;
		$this->date_publication=$date_publication;
	}

	public function Add() {
		$query = "INSERT INTO article (user_id,categorie_id,titre,entete,contenu,date_publication) "
				."VALUES ('"
								. $this->user_id . "','"
								. $this->categorie_id . "','"
								. $this->titre . "','"
								. $this->entete . "','"
								. $this->contenu . "',
									NOW());";
		return DBexec($query);
	}
}
?>


